public class lk876 {
        public ListNode middleNode(ListNode head) {
            int t=0;
            ListNode a[]=new ListNode();
            while(head!=null){
                a[t++]=head;
                head =head.next;
            }
            return a[t/2];
            
        }
}
